window.addEvent("domready",function(){if(document.id("reader")){var F={domain:docDomain,duration:2592E3,path:"/"},la=document.id("reader"),N,O,P,T,R=document.id("bookviewerhelp"),v=document.id("gotopage"),y=document.id("gotopage2"),e=v.options,g=document.id("multipage"),n=document.getElements(".gxf-mutlipage"),ma=document.id("hlbar"),fa=document.id("rubs"),ga=document.id("bmcnt"),s,J=document.id("search-book"),m=J.getElements("#search-book-form")[0],k=document.id("bm-book"),G=document.id("dl-win"),
W=document.id("breadcumbs"),S=document.id("rubsresizer"),z=!1,ha=document.id("booktitle"),C="gfx",l;l="undefined"!=typeOf(localStorage)?"onepage"!=localStorage.getItem("m2a")&&""!=localStorage.getItem("m2a"):"onepage"!=Cookie.read("m2a")&&""!=Cookie.read("m2a");var U=Boolean(bLoadFullScreen),L=String(szLoadYandexHL),D=e.length,ia=-1,c=l?2*Math.floor(Number(iLoadPage/2)):Number(iLoadPage);if(Number(iLoadPageReal)){var X=0;v.getElements("option").each(function(a){a.get("text")==iLoadPage&&(c=l?2*Math.floor(X/
2):X);X++})}if(0==c&&""!=iLoadPage&&""!=L)for(var b=0;b<D;b++)if("1"==e[b].getAttribute("ishl")){iLoadPage=c=l?2*Math.floor(b/2):b;break}var q=1,ja=!0,Y=null,h=0,H=0,d=Array(null),w=0,u=0,Q,Z,ka,aa,ba=!0;"undefined"!=typeOf(localStorage)?((h=localStorage.getItem("zoomlevel"))||localStorage.setItem("bZoomToW","1"),localStorage.getItem("bZoomToH"),localStorage.getItem("bZoomToW")):((h=Cookie.read("zoomlevel"))||Cookie.write("bZoomToW","1",F),Cookie.read("bZoomToH"),Cookie.read("bZoomToW"));SqueezeBox.assign(document.getElements("a[rel=funddesc][href^=#]"),
{size:{x:"70%",y:"70%"}});SqueezeBox.assign(document.getElements("div[rel=funddesc][href^=#]"),{size:{x:"50%",y:"50%"}});window.byclick=z=window.nocurupdate=!1;setTimeout(function(){ba=!0;document.getElements(l?".toolbar .twopage":".toolbar .onepage").fireEvent("click");document.getElements("gfx"==C?".toolbar .gfx":".toolbar .html").addClass("dis");ba=!1;window.fireEvent("resize");noGraphMode&&document.getElements(".toolbar .html").fireEvent("click");f();K()},1);var f=function(a){z=!1;clearInterval(O);
clearInterval(P);clearInterval(N);"winSearch"!=a&&(new Fx.Morph(J,{duration:100,link:"chain",onComplete:function(){J.setStyles({display:"none"})}})).start({opacity:0});"winBm"!=a&&(new Fx.Morph(k,{duration:100,link:"chain",onComplete:function(){k.setStyles({display:"none"})}})).start({opacity:0});"winDL"!=a&&(new Fx.Morph(G,{duration:100,link:"chain",onComplete:function(){G.setStyles({display:"none"})}})).start({opacity:0})};window.gotoPageByOrd=function(a,V,g){f();for(b=0;b<e.length;b++)if(e[b].getAttribute("xord")==
a){c=b;c=l?2*Math.floor(c/2):c;t(!V,g);p();E();break}};var t=function(a,b){f();a&&(window.byclick=!0,window.nocurupdate=!0);n.removeClass("current");n[c].addClass("current");n[c+1]&&l&&n[c+1].addClass("current");b||g.scrollTo(0,n[c].getAttribute(l?"curpos2":"curpos"))},K=function(){try{var a=g.scrollTop.toInt(),V=a+g.getSize().y/2+g.getStyle("padding-top").toInt(),f=-1,r=[],h=[],d,t;n.removeClass("current");for(b=0;b<D;b++){var A=n[b],k=l?A.getAttribute("curpos2").toInt():A.getAttribute("curpos").toInt(),
w=A.getAttribute("curh").toInt();A.getElement("div");(k<=V&&k>=a||k>=a&&k<V)&&h.push(b);(k>=a&&k<=a+Q||k+w>=a&&k+w<=a+Q||k<a&&k+w>a+Q)&&r.push(b)}f=window.byclick?c:h.length?h[l?h[1]?1:0:0]:r[l?r[1]?1:0:0];d=r.min();t=r.max();for(var u,a=1;a<q+1;a++)(u=t+a)<D&&r.push(u);for(a=1;a<q+1;a++)0<=(u=d-a)&&r.push(u);for(b=0;b<D;b++)r.contains(b)||(n[b].set("html",""),n[b].setProperty("loaded","0"));for(d=0;d<r.length;d++)if((A=n[r[d]])&&"1"!=A.getProperty("loaded")&&"1"!=A.getProperty("loaded")){A.setProperty("loaded",
"1");A.addClass("loading");var m,v;(m=A.getElement(".wrap"))||(m=(new Element("div",{"class":"wrap"})).inject(A));"gfx"==C&&((v=m.getElement("img"))?v.set("src","/textpage/image/?bookhl="+L+"&z=0&h="+A.getAttribute("curh")+"&w=&book="+escape(szBookURL)+"&page="+e[r[d]].getAttribute("xfilename")):(v=(new Element("img",{src:"/textpage/image/?bookhl="+L+"&z=0&h="+A.getAttribute("curh")+"&w=&book="+escape(szBookURL)+"&page="+e[r[d]].getAttribute("xfilename")})).inject(m),v.setAttribute("xord",r[d]),v.addEvent("click",
function(){gotoPageByOrd(this.getAttribute("xord"),!1,!0)}),v.addEvent("load",function(){if(this.getParent(".wrap")){var a,b;(a=this.getParent(".wrap").getElement(".hl"))&&(b=a.getElements(".yahlbox"))&&b.fade(0.6);(a=this.getParent(".gxf-mutlipage"))&&a.removeClass("loading")}})));var s=e[r[d]].getAttribute("xbox").split("|");if(s.length&&""!=s||"1"==e[r[d]].getAttribute("ishl")){var z,x=A.getAttribute("curh")/e[r[d]].getAttribute("xh"),B,G;if(z=m.getElement(".hl"))for(I=0;I<s.length;I++)""!=s[I]&&
(B=s[I].split(","),G=z.getElement('.yahlbox[rel="b'+I+'"]'),G.setStyles({top:B[0]*x-0-5*x,left:B[1]*x-0-5*x,height:(B[2]-B[0])*x+5*x,width:(B[3]-B[1])*x+5*x}));else z=(new Element("div",{"class":"hl",tween:{duration:100},styles:{opacity:1}})).inject(m);if("gfx"==C&&!z.getElement(".yahlbox"))for(var I=0;I<s.length;I++)""!=s[I]&&(B=s[I].split(","),G=(new Element("div",{"class":"yahlbox",rel:"b"+I,styles:{top:B[0]*x-0-5*x,left:B[1]*x-0-5*x,height:(B[2]-B[0])*x+5*x,width:(B[3]-B[1])*x+5*x,opacity:0}})).inject(z).set("tween",
{duration:100}).fade(0))}if("html"==C){var H;(H=m.getElement("iframe"))||(H=(new Element("iframe",{src:"----"==e[r[d]].getAttribute("xfilename")?"/textpage/html/?book=blankbook&page="+e[r[d]].getAttribute("xord"):"/textpage/html/?bookhl="+L+"&book="+escape(szBookURL)+"&page="+e[r[d]].getAttribute("xord"),frameborder:!1})).inject(m),H.addEvent("load",function(){try{this.getParent(".gxf-mutlipage").removeClass("loading")}catch(a){}}))}if("undefined"!=typeOf(localStorage)){var F;if(!(F=m.getParent("div").getElement(".bmdiv"))){var y=
JSON.parse(localStorage.getItem(szHostName+"/"+szBookURL+"/"+r[d]));F=(new Element("div",{"class":" bmdiv bm "+(y&&0<y.color?"act":""),tween:{duration:100},styles:{opacity:y&&0<y.color?1:0.3,backgroundPosition:y&&0<y.color?String(-21*y.color+"px top"):"left top"}})).inject(m.getParent("div"));F.setProperty("pageno",r[d]);F.addEvents({mouseover:function(){this.fade(1)},mouseout:function(){this.hasClass("act")||this.fade(0.3)},click:function(){var a=szHostName+"/"+szBookURL+"/"+this.getProperty("pageno"),
b=JSON.parse(localStorage.getItem(a));null==b?(localStorage.setItem(a,JSON.stringify({color:1,yahl:L})),this.setStyle("background-position","-21px top"),this.addClass("act")):0<b.color&&4>b.color?(localStorage.setItem(a,JSON.stringify({color:Number(b.color)+1,yahl:L})),this.setStyle("background-position",String(-21*(Number(b.color)+1)+"px top")),this.addClass("act")):(localStorage.removeItem(a),this.setStyle("background-position","left top"),this.removeClass("act"));ca()}})}}}-1<iLoadPage&&(c=Number(iLoadPage),
setTimeout(function(){iLoadPage=-1},100));c=l?2*Math.floor(f/2):f;n[c].addClass("current");n[c+1]&&l&&n[c+1].addClass("current");window.byclick||(p(),E());window.byclick=!1;window.nocurupdate=!1}catch(J){clearTimeout(T),T=setTimeout(K,50)}};g.addEvents({scroll:function(){clearTimeout(T);T=setTimeout(K,50)},focus:function(){f();g.focused=!0},blur:function(){g.focused=!1}});g.set("tabIndex",0).focus();fa.set("tabIndex",1);fa.addEvent("focus",function(){f()});var ca=function(){if("undefined"!=typeOf(localStorage)){s=
[];for(b=0;b<D;b++){var a=JSON.parse(localStorage.getItem(szHostName+"/"+szBookURL+"/"+b));a&&a&&0<a.color&&s.push({xord:b,label:e[b].text,col:a.color})}a=s.length;ga.set("text",a);ga[a?"removeClass":"addClass"]("zero")}},M=function(){g.setStyle("top",document.getElements("h1.pagetitle")[0].getDimensions().y+38);ma.setStyle("top",document.getElements("h1.pagetitle")[0].getDimensions().y+38+16);var a=d[h],b=0,c=0,e=0;n.each(function(d){var f;d.setStyle("height",(f=Math.floor(d.getAttribute("xh")*a))+
"px");d.setStyle("width",Math.floor(d.getAttribute("xw")*a)+"px");d.set("curh",f);d.set("curpos",b);d.set("curpos2",c);d.setProperty("loaded","0");b+=f+aa;c+=e%2?f+aa:0;e++});t()},da=function(){var a=n[0].getAttribute("xh"),c=n[0].getAttribute("xw");aa=n[0].getStyle("margin-bottom").toInt();ka=g.getStyle("padding-top").toInt();Q=g.getDimensions().height-2*ka;Z=g.getDimensions().width-g.getStyle("padding-left").toInt()-g.getStyle("padding-right").toInt()-30;if(!(50>Q||50>Z)){d=[];w=Q/a;u=Number((Z/
(c*(l?2:1))).toFixed(5));d.push(w);d.push(u);for(b=1.5;3>b;b+=0.5)d.push(Number((w/b).toFixed(5)));for(b=1.5;3>b;b+=0.5)d.push(Number((w*b).toFixed(5)));for(b=1;3>b;b+=0.5)d.push(Number((u/b).toFixed(5)));for(b=1;3>b;b+=0.5)d.push(Number((u*b).toFixed(5)));d=d.unique();d.sort()}};window.addEvent("resize",function(){if(!ba){f();clearTimeout(Y);var a=0;W&&W.id&&(a=W.getDimensions().height);la.setStyle("height",window.getSize().y-(document.body.hasClass("fullscreen")?15+a:$("footer").getSize().y+175-
a));document.getElements("#rubs, #rubsresizer, #resizerGhost").setStyle("top",document.getElements("h1.pagetitle")[0].getDimensions().y+38);da();"undefined"!=typeOf(localStorage)?("1"==localStorage.getItem("bZoomToW")&&(h=d.indexOf(u)),"1"==localStorage.getItem("bZoomToH")&&(h=d.indexOf(w))):("1"==Cookie.read("bZoomToW")&&(h=d.indexOf(u)),"1"==Cookie.read("bZoomToH")&&(h=d.indexOf(w)));if(""===h||null===h||void 0===h)h=d.indexOf(u);M();ja?ja=!1:Y=setTimeout(function(){Y=null;K();p()},200)}});Browser.ie8?
document.getElements(".toolbar .rotccw").setStyle("visibility","hidden"):document.getElements(".toolbar .rotccw").addEvent("click",function(){if(!this.hasClass("dis")){var a=l?document.getElements(".current").getParent(".mode2")[0]:document.getElements(".current")[0];a&&(a.hasClass("rot-90")?(a.removeClass("rot-90"),a.addClass("rot180")):a.hasClass("rot180")?(a.removeClass("rot180"),a.addClass("rot90")):a.hasClass("rot90")?a.removeClass("rot90"):a.addClass("rot-90"))}});Browser.ie8?document.getElements(".toolbar .rotcw").setStyle("visibility",
"hidden"):document.getElements(".toolbar .rotcw").addEvent("click",function(){var a=l?document.getElements(".current").getParent(".mode2")[0]:document.getElements(".current")[0];a&&(a.hasClass("rot90")?(a.removeClass("rot90"),a.addClass("rot180")):a.hasClass("rot180")?(a.removeClass("rot180"),a.addClass("rot-90")):a.hasClass("rot-90")?a.removeClass("rot-90"):a.addClass("rot90"))});ha.set("tween",{duration:150}).setStyle("opacity",1);ha.set("html",bookData.title);document.getElements(".toolbar .hidehl").addEvent("click",
function(){document.getElements(".yahlcontrol").removeClass("yahlcontrol");document.getElements(".yahlbox").destroy();document.getElements(".hl").removeClass("hl").empty();document.getElements(".toolbar .gophl, .toolbar .gonhl").setStyle("display","none");document.getElements("option").each(function(a){a.setAttribute("ishl","");a.setAttribute("xbox","")});document.getElements(".gxf-mutlipage").set("loaded","");K();L="";this.setStyle("display","none");document.getElements(".gxf-mutlipage iframe").each(function(a){try{a.contentDocument.clearHL()}catch(b){}});
return!1});document.getElements(".toolbar .gophl").addEvent("click",function(){f();if(this.hasClass("dis"))return!1;var a=l?2*Math.floor(c/2):c;if(l)for(b=a-q;0<=b;b-=q){if(e[b]&&"1"==e[b].getAttribute("ishl")||e[b+1]&&"1"==e[b+1].getAttribute("ishl")){c=b;t(!0);p();E();break}}else for(b=a-q;0<=b;b-=q)if(e[b]&&"1"==e[b].getAttribute("ishl")){c=b;t(!0);p();E();break}return!1});document.getElements(".toolbar .gonhl").addEvent("click",function(){f();if(this.hasClass("dis"))return!1;var a=l?2*Math.floor(c/
2):c;if(l)for(b=a+q;b<D;b+=q){if(e[b]&&"1"==e[b].getAttribute("ishl")||e[b+1]&&"1"==e[b+1].getAttribute("ishl")){c=b;t(!0);p();E();break}}else for(b=a+q;b<D;b+=q)if(e[b]&&"1"==e[b].getAttribute("ishl")){c=b;t(!0);p();E();break}return!1});document.getElements(".toolbar .gof").addEvent("click",function(){f();c=0;t(!0);p();E();return!1});document.getElements(".toolbar .gop").addEvent("click",function(){f();if(this.hasClass("dis"))return!1;c-=q;c=Math.max(0,c);t(!0);p();E();return!1});document.getElements(".toolbar .gon").addEvent("click",
function(){f();if(this.hasClass("dis"))return!1;c+=q;c=Math.min(c,D-1);t(!0);p();E();return!1});document.getElements(".toolbar .gol").addEvent("click",function(){f();if(this.hasClass("dis"))return!1;c=D-1;c=l?2*Math.floor(c/2):c;t(!0);p();E();return!1});document.getElements(".gotoanchor").addEvent("click",function(){f();window.byclick=!0;c=Number(this.getAttribute("xpageord"));t(!0);p();E();return!1});document.getElements(".gotoanchor ins").addEvent("click",function(a){f();var b=this.getParent("a");
b.hasClass("opera")&&null==b.getAttribute("xchild")||(document.getElements(".children[xparent="+b.get("xchild")+"]").toggleClass("open"),b.toggleClass("open"),console.log(b),console.log(!b.hasClass("opera")||null!=b.getAttribute("xchild")));a.stop();a.preventDefault();return!1});document.getElements(".toolbar .gfx").addEvent("click",function(){f();this.hasClass("dis")||(this.addClass("dis"),noTextMode||document.getElements(".toolbar .html").removeClass("dis"),g.removeClass("htmlmode"),C="gfx",h=H,
"W"==H&&(h=d.indexOf(u)),"H"==H&&(h=d.indexOf(w)),M(),K(),p())});document.getElements(".toolbar .html").addEvent("click",function(){f();this.hasClass("dis")||(this.addClass("dis"),noGraphMode||document.getElements(".toolbar .gfx").removeClass("dis"),document.getElements(".rot90").removeClass("rot90"),document.getElements(".rot-90").removeClass("rot-90"),document.getElements(".rot100").removeClass("rot180"),g.addClass("htmlmode"),C="html",H=h,"undefined"!=typeOf(localStorage)?("1"==localStorage.getItem("bZoomToH")&&
(H="H"),"1"==localStorage.getItem("bZoomToW")&&(H="W")):("1"==Cookie.read("bZoomToH")&&(H="H"),"1"==Cookie.read("bZoomToW")&&(H="W")),h=d.indexOf(w),M(),K(),p())});v.addEvent("change",function(a){f();c=this.selectedIndex;y.selectedIndex=Math.floor(c/2);t(!0);p();E()});y.addEvent("change",function(a){f();c=v.selectedIndex=2*this.selectedIndex;t(!0);p();E()});document.getElements(".toolbar .fullscreen").addEvent("click",function(){f();U=!this.hasClass("act");document.getElements("#breadcumbs")[this.hasClass("act")?
"addClass":"removeClass"]("hidden");document.body.toggleClass("fullscreen");this.toggleClass("act");if(window.history&&window.history.pushState&&-1==iLoadPage){var a=window.location.pathname.replace(";rl,1","").replace("/fs,","/go,0;fs,"),a=-1<a.indexOf(";")?a.replace(/go,(\d*)/ig,"go,"+c).replace(/fs,(\d?)/ig,"fs,"+(U?"1":"0")):a+"/go,"+c+";fs,"+(U?"1":"0")+"/";window.history.replaceState(JSON.stringify({iCurPage:c}),"",a.replace("//","/")+window.location.search)}window.byclick=!0;window.fireEvent("resize");
window.byclick=!0;K()});document.getElements(".toolbar .zoomw").addEvent("click",function(){f();this.hasClass("dis")||(h=d.indexOf(u),p(),M(),g.fireEvent("scroll"))});document.getElements(".toolbar .zoomh").addEvent("click",function(){f();this.hasClass("dis")||(h=d.indexOf(w),p(),M(),g.fireEvent("scroll"))});document.getElements(".toolbar .zoomin").addEvent("click",function(){f();this.hasClass("dis")||(h++,p(),M(),g.fireEvent("scroll"))});document.getElements(".toolbar .zoomout").addEvent("click",
function(){f();this.hasClass("dis")||(h--,p(),M(),g.fireEvent("scroll"))});document.getElements("#hlbar td").addEvent("click",function(){f();gotoPageByOrd(this.getAttribute("xord"))});new Tips("#hlbar td",{className:"hlbarprev",onShow:function(a,b){var c,d=e[Number(b.getAttribute("xrel"))];a.set("tween",{duration:100});(c=a.getElement("img"))?(c.set("src","/textpage/image/?thumb=1&h=&book="+escape(szBookURL)+"&page="+d.getAttribute("xfilename")),a.getElement("span").set("text",d.text),a["1"==d.getAttribute("ishl")?
"addClass":"removeClass"]("yahlcontrol")):((new Element("img",{src:"/textpage/image/?thumb=1&h=&book="+escape(szBookURL)+"&page="+d.getAttribute("xfilename")})).inject(a),(new Element("span",{text:d.text})).inject(a));a.fade(1)},onHide:function(a,b){a.fade(0)}});document.getElements(".toolbar .onepage").addEvent("click",function(){f();try{if(this.hasClass("dis"))return!1;l=!1;q=1;"undefined"!=typeOf(localStorage)?localStorage.setItem("m2a","onepage"):Cookie.write("m2a","onepage",F);this.addClass("dis");
document.getElements(".toolbar .twopage").removeClass("dis");document.getElements(".rot90").removeClass("rot90");document.getElements(".rot-90").removeClass("rot-90");document.getElements(".rot180").removeClass("rot180");g.removeClass("mode2act");v.setStyle("display","inline-block");y.setStyle("display","none");da();window.fireEvent("resize")}catch(a){}return!1});document.getElements(".toolbar .twopage").addEvent("click",function(){f();try{if(this.hasClass("dis"))return!1;l=!0;q=2;"undefined"!=typeOf(localStorage)?
localStorage.setItem("m2a","twopage"):Cookie.write("m2a","twopage",F);this.addClass("dis");document.getElements(".toolbar .onepage").removeClass("dis");document.getElements(".rot90").removeClass("rot90");document.getElements(".rot-90").removeClass("rot-90");document.getElements(".rot180").removeClass("rot180");g.addClass("mode2act");v.setStyle("display","none");y.setStyle("display","inline-block");da();window.fireEvent("resize")}catch(a){}return!1});document.getElements(".toolbar .help").addEvent("click",
function(a){f();R.toggleClass("visible");a.preventDefault();a.stop();return!1});R.addEvent("click",function(){this.removeClass("visible")});document.getElements(".tbtn.home").addEvent("click",function(a){f();window.location.href="/";return!1});m.getElements('input[name="query"]').addEvents({focus:function(){this.focused=!0},blur:function(){this.focused=!1}});new Form.Request(m,null,{evalScripts:!0,useSpinner:!0,resetForm:!1,emulation:!1,onSend:function(a){m.getElements(".open").setStyle("display",
"block");document.body.addClass("reloading")},onFailure:function(a){m.getElements(".empty").setStyle("display","block");m.getElements(".open").setStyle("display","none")},onSuccess:function(a){a=this.request.response.text.split("|");"0"==a[0]?(m.getElements(".empty").setStyle("display","block"),m.getElements(".open").setStyle("display","none")):(m.getElements(".empty").setStyle("display","none"),m.getElements(".open").setStyle("display","block"),m.getElements("input").set("disabled","disabled").setStyle("opacity",
0.4),console.log(a),window.location.replace(a[1].replace(/go,(\d*)/ig,"").replace(";fs","fs")))}});document.getElements(".toolbar .search").addEvent("click",function(a){f("winSearch");this.hasClass("dis")||(z=!0,(new Fx.Morph(J,{duration:200,link:"chain",onStart:function(){J.setStyles({display:"block"});document.getElements("#search-book-form input")[0].focus()}})).set({opacity:0}).start({opacity:1}));a.stop();a.preventDefault();return!1});document.getElements("#search-book-form input")[0].addEvent("keydown",
function(){document.getElements("#search-book-form .empty").setStyle("display","none")});J.addEvent("mouseenter",function(){clearInterval(N)});J.addEvent("mouseleave",function(){clearInterval(O);clearInterval(P);clearInterval(N);N=setInterval(function(){m.getElements('input[name="query"]')[0].focused||(new Fx.Morph(k,{duration:100,link:"chain",onComplete:function(){z=!1;k.setStyles({display:"none"})}})).start({opacity:0})},1E3)});"undefined"!=typeOf(localStorage)?(document.getElements(".toolbar .bookmarks").addEvent("click",
function(){f("winBm");var a=k.getElement("form").set("html","");k.getElement(".empty").setStyle("display",s.length?"none":"block");if(s.length)for(b=0;b<s.length;b++){var d=(new Element("a",{xord:s[b].xord,href:"",text:s[b].label})).inject(a),e=(new Element("span",{"class":"c3"})).inject(d);(new Element("ins")).setStyle("backgroundPosition",7*-s[b].col+"px top").inject(d);d.addEvent("click",function(a){k.setStyle("display","none");c=Number(this.getProperty("xord"));c=l?2*Math.floor(c/2):c;t();p();
a.stop();a.preventDefault();return!1});e.addEvent("click",function(a){var b=this.getParent("a"),c=szHostName+"/"+szBookURL+"/"+b.getProperty("xord");try{n[Number(b.getProperty("xord"))].getElement(".bm").removeClass("act").setStyles({opacity:0.3,backgroundPosition:"left top"})}catch(d){}localStorage.removeItem(c);b.destroy();k.getElement(".empty").setStyle("display",document.getElements("#bmbook a").length?"none":"block");ca();a.stop();a.preventDefault();return!1})}(new Fx.Morph(k,{duration:200,link:"chain",
onStart:function(){k.setStyles({display:"block"})}})).set({opacity:0}).start({opacity:1});z=!0}),k.addEvent("mouseenter",function(){clearInterval(O)}),k.addEvent("mouseleave",function(){clearInterval(O);clearInterval(P);clearInterval(N);O=setInterval(function(){(new Fx.Morph(k,{duration:100,link:"chain",onComplete:function(){z=!1;k.setStyles({display:"none"})}})).start({opacity:0})},1E3)})):document.getElements(".toolbar .bookmarks").setStyle("display","none");document.getElements(".toolbar .down").addEvent("click",
function(){f("winDL");(new Fx.Morph(G,{duration:200,link:"chain",onStart:function(){G.setStyles({display:"block"})}})).set({opacity:0}).start({opacity:1});z=!0});G.addEvent("mouseenter",function(){clearInterval(P)});G.addEvent("mouseleave",function(){clearInterval(O);clearInterval(P);clearInterval(N);P=setInterval(function(){(new Fx.Morph(G,{duration:100,link:"chain",onComplete:function(){z=!1;G.setStyles({display:"none"})}})).start({opacity:0})},1E3)});window.addEvent("popstate",function(a){a.event.state&&
(a=JSON.parse(a.event.state),c==a.iCurPage||0>a.iCurPage||(c=l?2*Math.floor(a.iCurPage/2):a.iCurPage,t(!0),p()))});var E=function(){if(window.history&&window.history.pushState&&-1==iLoadPage&&c!=ia){ia=c;var a=window.location.pathname.replace("/fs,1/","/go,0;fs,1/").replace("/fs,0/","/go,0;fs,0/").replace(";rl,1",""),a=-1<a.indexOf(";")?a.replace(/go,(\d*)/ig,"go,"+c):a+"/go,"+c+";fs,"+(U?"1":"0")+"/";window.history.pushState(JSON.stringify({iCurPage:c}),"",a.replace("//","/")+window.location.search)}},
p=function(){var a=l?2*Math.floor(c/2):c;"gfx"==C&&("undefined"!=typeOf(localStorage)?(localStorage.setItem("zoomlevel",h),localStorage.setItem("bZoomToH",d[h]==w?"1":"0"),localStorage.setItem("bZoomToW",d[h]==u?"1":"0")):(Cookie.write("zoomlevel",h,F),Cookie.write("bZoomToH",d[h]==w?"1":"0",F),Cookie.write("bZoomToW",d[h]==u?"1":"0",F)));R.removeClass("visible");l?e[a]&&"1"==e[a].getAttribute("ishl")||e[a+1]&&"1"==e[a+1].getAttribute("ishl")?document.getElements(y).addClass("yahlcontrol"):document.getElements(y).removeClass("yahlcontrol"):
"1"==e[c].getAttribute("ishl")?document.getElements(v).addClass("yahlcontrol"):document.getElements(v).removeClass("yahlcontrol");document.getElements(".toolbar .gof")[1>c?"addClass":"removeClass"]("dis");document.getElements(".toolbar .gop")[1>c?"addClass":"removeClass"]("dis");document.getElements(".toolbar .gon")[c>D-1-q?"addClass":"removeClass"]("dis");document.getElements(".toolbar .gol")[c>D-1-q?"addClass":"removeClass"]("dis");v.selectedIndex=c;y.selectedIndex=Math.floor(c/2);document.getElements(".toolbar .gonhl, .toolbar .gophl").addClass("dis");
if(l){for(b=a-q;0<=b;b-=q)if(e[b]&&"1"==e[b].getAttribute("ishl")||e[b+1]&&"1"==e[b+1].getAttribute("ishl")){document.getElements(".toolbar .gophl").removeClass("dis");break}for(b=a+q;b<D;b+=q)if(e[b]&&"1"==e[b].getAttribute("ishl")||e[b+1]&&"1"==e[b+1].getAttribute("ishl")){document.getElements(".toolbar .gonhl").removeClass("dis");break}}else{for(b=a-q;0<=b;b--)if(e[b]&&"1"==e[b].getAttribute("ishl")){document.getElements(".toolbar .gophl").removeClass("dis");break}for(b=a+q;b<D;b++)if(e[b]&&"1"==
e[b].getAttribute("ishl")){document.getElements(".toolbar .gonhl").removeClass("dis");break}}document.getElements(".toolbar .zoomin")[h<d.length-1&&"html"!=C?"removeClass":"addClass"]("dis");document.getElements(".toolbar .zoomout")[0<h&&"html"!=C?"removeClass":"addClass"]("dis");document.getElements(".toolbar .zoomw")[d[h]!=u&&"html"!=C?"removeClass":"addClass"]("dis");document.getElements(".toolbar .zoomh")[d[h]!=w&&"html"!=C?"removeClass":"addClass"]("dis");document.getElements(".toolbar .rotccw")["html"!=
C?"removeClass":"addClass"]("dis");document.getElements(".toolbar .rotcw")["html"!=C?"removeClass":"addClass"]("dis");ca();var a=e[c].getAttribute("xcontentslist").split(" "),f=null;document.getElements(".gotoanchor").removeClass("hl");a.each(function(a){document.getElements('.gotoanchor[xord="'+a+'"]').addClass("hl")});if(f=a.pop()){var g=document.getElement('.gotoanchor[xord="'+f+'"]'),k=g.getParent("div.rubscnt");g.getParents("div.children").each(function(a){a.addClass("open");document.getElements('.gotoanchor[xchild="'+
+a.get("xparent")+'"]').addClass("open")})}try{var m=g;document.getElements(".gotoanchor.hl").each(function(a){!0==a.isVisible()&&(m=a)});(0>m.getPosition(k).y||m.getPosition(k).y>k.offsetHeight)&&m.scrollIntoView()}catch(p){}if("undefined"!=typeof operaData){var n=null;Object.each(operaData,function(a){c>=a.from&&c<=a.to&&(n=a)});n&&n.bibdesc&&n.title?(document.id("opusdesc").setStyle("display","block"),document.id("opusdesc").getElement(".pagetitle").set("html",ea(n.title)),document.id("opusdesc").getElement(".descph").set("html",
ea(n.bibdesc)),document.id("opusdesc").getElement(".fieldph").set("html",ea(n.fielddesc))):document.id("opusdesc").setStyle("display","none")}};document.getElements(".toolbar .rubs").addEvent("click",function(){f();"undefined"!=typeOf(localStorage)?localStorage.setItem("hiderubs",document.body.hasClass("hiderubs")?"":"off"):Cookie.write("hiderubs",document.body.hasClass("hiderubs")?"":"off",F);document.body.toggleClass("hiderubs");Browser.ie8&&(document.id("rubs").setStyle("display",document.body.hasClass("hiderubs")?
"none":""),document.id("rubsresizer").setStyle("display",document.body.hasClass("hiderubs")?"none":""));window.fireEvent("resize")});setTimeout(function(){var a=S.clone().addClass("resizerGhost").set("id","resizerGhost").inject(S,"before");new Drag(S,{snap:0,limit:{x:[150,Math.max(400,g.getSize().x-400)],y:[S.getStyle("top").toInt(),S.getStyle("top").toInt()]},onSnap:function(b){b.addClass("dragging");a.setStyles({top:$("rubsresizer").getStyle("top"),left:b.getStyle("left").toInt(),display:"block"})},
onComplete:function(b){b.removeClass("dragging");$("rubs").setStyle("width",b.getStyle("left").toInt()-5);a.setStyles({left:b.getStyle("left").toInt()-4,display:"none"});g.setStyle("left",b.getStyle("left").toInt()+1);window.fireEvent("resize")}})},200);window.addEvent("keyup",function(a){if(z)return 27==a.code&&f(),a.preventDefault(),a.stop(),!1;if(R.hasClass("visible"))return R.removeClass("visible"),a.preventDefault(),a.stop(),!1;a.preventDefault();a.stop();switch(a.code){case 33:if(g.focused)break;
document.getElements(".toolbar .gop").fireEvent("click");break;case 38:if(g.focused)break;document.getElements(".toolbar .gop").fireEvent("click");break;case 37:if(g.focused)break;document.getElements(".toolbar .gop").fireEvent("click");break;case 34:if(g.focused)break;document.getElements(".toolbar .gon").fireEvent("click");break;case 40:if(g.focused)break;document.getElements(".toolbar .gon").fireEvent("click");break;case 39:if(g.focused)break;document.getElements(".toolbar .gon").fireEvent("click");
break;case 36:document.getElements(".toolbar .gof").fireEvent("click");break;case 35:document.getElements(".toolbar .gol").fireEvent("click");break;case 192:document.getElements(".toolbar .fullscreen").fireEvent("click");break;case 107:document.getElements(".toolbar .zoomin").fireEvent("click");break;case 109:document.getElements(".toolbar .zoomout").fireEvent("click");break;case 106:document.getElements(".toolbar .zoomh").fireEvent("click");break;case 111:document.getElements(".toolbar .zoomw").fireEvent("click");
break;case 49:document.getElements(".toolbar .onepage").fireEvent("click");break;case 50:document.getElements(".toolbar .twopage").fireEvent("click")}return!1})}Element.Properties.transform={set:function(a){var b="transform";Browser.Engine.webkit&&(b="WebkitTransform");Browser.Engine.gecko&&(b="MozTransform");Browser.Engine.presto&&(b="OTransform");this.style[b]=a;this.store("transform",a)},get:function(){return this.retrieve("transform","")}};Element.implement({setTransform:function(a){return this.set("transform",
a)},getTransform:function(){return this.get("transform")}});Element.implement({checkOverflow:function(){return this.offsetHeight<this.scrollHeight||this.offsetWidth<this.scrollWidth}});var ea=function(){var a=document.createElement("div");return function(b){b&&"string"===typeof b&&(b=b.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi,""),b=b.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi,""),a.innerHTML=b,b=a.textContent,a.textContent="");return b}}()});
